package com.ruoyi.domain;

import java.beans.Transient;
import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 库存管理对象 erp_inventory
 * 
 * @author zhp
 * @date 2025-08-04
 */
public class ErpInventory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** id*/
    private Long id;

    /** 物料ID */
    private Long materialId;

    /** 仓库ID */
    private Long warehouseId;

    /** 库区ID */
    private Long areaId;

    /** 批次号 */
    private String batchNo;

    /** 库存数量 */
    private BigDecimal quantity;

    /** 锁定数量 */
    private BigDecimal lockedQuantity;

    /** 单位 */
    private String unit;

    /** 生产日期 */
    private Date productionDate;

    /** 过期日期 */
    private Date expiryDate;

    /** 状态(1:正常,2:待检,3:不良品) */
    private Long status;

    /** 创建时间 */
    private Date createdAt;

    /** 更新时间 */
    private Date updatedAt;

    //添加物料对象关联
    private ErpMaterial material ;

    //添加仓库对象关联
    private ErpWarehouse warehouse;

    //添加库区物料关联
    private ErpStorageArea storageArea;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setMaterialId(Long materialId) 
    {
        this.materialId = materialId;
    }

    public Long getMaterialId() 
    {
        return materialId;
    }

    public void setWarehouseId(Long warehouseId) 
    {
        this.warehouseId = warehouseId;
    }

    public Long getWarehouseId() 
    {
        return warehouseId;
    }

    public void setAreaId(Long areaId) 
    {
        this.areaId = areaId;
    }

    public Long getAreaId() 
    {
        return areaId;
    }

    public void setBatchNo(String batchNo) 
    {
        this.batchNo = batchNo;
    }

    public String getBatchNo() 
    {
        return batchNo;
    }

    public void setQuantity(BigDecimal quantity) 
    {
        this.quantity = quantity;
    }

    public BigDecimal getQuantity() 
    {
        return quantity;
    }

    public void setLockedQuantity(BigDecimal lockedQuantity) 
    {
        this.lockedQuantity = lockedQuantity;
    }

    public BigDecimal getLockedQuantity() 
    {
        return lockedQuantity;
    }

    public void setUnit(String unit) 
    {
        this.unit = unit;
    }

    public String getUnit() 
    {
        return unit;
    }

    public void setProductionDate(Date productionDate) 
    {
        this.productionDate = productionDate;
    }

    public Date getProductionDate() 
    {
        return productionDate;
    }

    public void setExpiryDate(Date expiryDate) 
    {
        this.expiryDate = expiryDate;
    }

    public Date getExpiryDate() 
    {
        return expiryDate;
    }

    public void setStatus(Long status) 
    {
        this.status = status;
    }

    public Long getStatus() 
    {
        return status;
    }

    public void setCreatedAt(Date createdAt) 
    {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() 
    {
        return createdAt;
    }

    public void setUpdatedAt(Date updatedAt) 
    {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt() 
    {
        return updatedAt;
    }

    public ErpMaterial getMaterial() {return material;}

    public void setMaterial(ErpMaterial material) {this.material = material;}

    public ErpWarehouse getWarehouse(){
        return warehouse;
    }

    public void setWarehouse(ErpWarehouse warehouse){
        this.warehouse = warehouse;
    }

    public ErpStorageArea getStorageArea(){
        return storageArea;
    }

    public void setStorageArea(ErpStorageArea storageArea){
        this.storageArea = storageArea;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("materialId", getMaterialId())
                .append("warehouseId", getWarehouseId())
                .append("areaId", getAreaId())
                .append("batchNo", getBatchNo())
                .append("quantity", getQuantity())
                .append("lockedQuantity", getLockedQuantity())
                .append("unit", getUnit())
                .append("productionDate", getProductionDate())
                .append("expiryDate", getExpiryDate())
                .append("status", getStatus())
                .append("createdAt", getCreatedAt())
                .append("updatedAt", getUpdatedAt())
                .append("material", getMaterial())
                .toString();
    }
}
